<?php
/**
 * @file
 * Returns the HTML for a single Drupal page.
 *
 * Complete documentation for this file is available online.
 * @see https://drupal.org/node/1728148
 */
?>

<?php print render($page['navigation']); ?>

<div id="page" ng-app="authors">
    <?php print render($page['help']); ?>

	<header class="header" id="header" role="banner">
		<div class="wrapper">

			<div class="menu-trigger"></div>
			<div class="search-trigger"></div>
			<div class="font-size-trigger"></div>
			<?php if ($logo): ?>
			<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="header__logo" id="logo">
                <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" class="header__logo-image" />
			</a>
			<?php endif; ?>

			<?php print render($page['header']); ?>

		</div>
	</header>

	<div id="main">
            <?php print $messages; ?>
            <?php print render($page['highlighted']); ?>
            <?php //echo bck_render_('ads-blog-1080x120');?>

            <div id="content" class="column region-content" role="main" ng-controller="authorsCtrl">
            <div class="wrapper">
                <?php //print $breadcrumb; ?>

            <?php //echo bck_render_('ads-mobile-top-320x90');?>
                <?php print render($title_prefix); ?>
                <?php print render($title_suffix); ?>
                <?php print render($tabs); ?>
                <?php if ($action_links): ?>
                <ul class="action-links"><?php print render($action_links); ?></ul>
                <?php endif; ?>

                <!-- profile -->
                <div id="author-profile">
                    <div class="profile-picture" ng-bind-html="profile.users_picture"></div>
                    <div class="profile-username" ng-bind="profile.field_display_username"></div>
                    <div class="profile-title" ng-bind="profile.field_profile_title"></div>
                    <div class="profile-social" >
                        <a ng-repeat="(k,v) in profile.field_social_network[0].field_link"
                            ng-href="{{v.url}}"
                            ng-attr-title="{{v.title}}"
                            ng-class="'icon-' + profile.field_social_network[0].field_website[k]">
                        </a>
                    </div>
                </div>

                <!-- content -->
                <div id="author-content">
                    <div class="content-item" ng-repeat="(k,v) in content">
                        <a ng-href="{{v.node_title | to_url}}">
                            <img ng-src="{{v.field_image | to_url}}" alt="">
                            <div class="item-name" ng-bind="v.node_title | to_text"></div>
                        </a>
                    </div>
                    <div id="content-loadmore" ng-click="loadmore()">LOAD MORE</div>
                </div>

                <!-- archives -->
                <div id="author-archives">
                    <h3><span>ARCHIVES</span></h3>
                    <div class="archives-items">
                        <div class="archives-item" ng-repeat="(k,v) in archives">
                            <a ng-href="{{v.url}}" ng-bind="v.link"></a>
                            <span ng-bind="'(' + v.num_records + ')'"></span>
                        </div>
                    </div>
                </div>

                <!-- popular -->
                <div id="author-popular">
                    <h3><span>POPULAR</span></h3>
                    <div class="popular-item" ng-repeat="(k,v) in popular">
                        <a ng-href="{{v.node_nodeviewcount_title | to_url}}">
                            <img ng-src="{{v.field_thumbnail | to_url}}" alt="">
                            <div class="item-name" ng-bind="v.node_nodeviewcount_title | to_text"></div>
                        </a>
                    </div>
                </div>




                <?php //print render($page['content']); ?>
                <?php //print $feed_icons; ?>
            </div>
            </div>
            <?php print render($page['below_content']); ?>
            <?php print render($page['bottom']); ?>
            <?php print render($page['footer']); ?>
	</div>

</div>

<?php print render($page['popup']); ?>
<?php print render($page['overlay']); ?>
<?php print render($page['hidden']); ?>
